This application is based on an application No. 10-216694 filed in Japan, the content of which is hereby incorporated by reference.
(1) Field of the Invention
The present invention relates to improvements in a technique of recognizing the orientation of a document image using an image forming apparatus such as a copier.
(2) Related Art
For making copies of documents, a user may use an automatic document feeder (ADF). In this case, when the user sets documents arranged in random orientations, i.e. the documents include pages that are upside down, the orientations of images formed on discharged recording sheets are also random in the same way as the documents having set by the user. Hereinafter, the recording sheets on which images have been formed are referred to as the xe2x80x9ccopied sheets.xe2x80x9d
To align the orientations of images formed on copied sheets, the user has to check the documents one by one and arrange the documents in the same orientation before setting the documents on the ADF.
However, this checking job causes great inconvenience. When making copies of a great number of documents, the user is likely to miss pages that are upside down. Due to imperfect checking, the user has to arrange the copied sheets in the same orientation again after the copying operations. When making copies of documents using a sort function, the user has to do this checking job after the copying operations for each copy stack. This takes much time and effort.
To address this problem, various methods have been suggested for recognizing the orientation of a document image and performing image rotation processing when necessary so that the image formed on a recording sheet is the right way up. Hereinafter, the processing for recognizing the orientation of a document image is referred to as the xe2x80x9corientation detection processing.xe2x80x9d
As one example of the orientation detecting method, the orientation of a document image is recognized by distribution of characters in the document image. This method is explained in detail below.
First, histograms of the main scanning and sub-scanning directions are generated from the document image data on which binarization processing has been performed according to, for example, the error diffusion method. Note that the binarization processing is performed in normal image processing. The generation of the histograms is achieved by adding up black pixels of the document image in the main scanning and sub-scanning directions respectively.
Distributions displayed by the two histograms of the main scanning and sub-scanning directions are used to recognize the orientation of the document image. More specifically, in one histogram, apart with a zero frequency and apart with anon-zero frequency may alternate. The parts with zero frequencies are spaced uniformly, and the parts with non-zero frequencies are also spaced uniformly. Here, a part with a zero frequency can be considered to correspond to a space between character lines of the document. From this distribution, the direction in which the characters are written is judged to be the main scanning or sub-scanning direction. Hereinafter, the direction in which characters are written (i.e. the main scanning or sub-scanning direction) is referred to as the xe2x80x9cline directionxe2x80x9d of the document.
After the line direction of the document is detected, the beginning of a character line is next detected using the other histogram. Here, it should be noted that although the English language is basically written horizontally, the Japanese language is written both horizontally and vertically. Also note that when the Japanese script is written vertically, it is written from right to left. When characters are written horizontally from left to right in English, for example, the beginning of each character line is on the left of the document. Meanwhile, when characters are written vertically in Japanese, for example, the beginning of each character line is at the top of the document. In this specification, regardless of whether characters are written horizontally or vertically, the beginning and end of each character line are respectively referred to as the xe2x80x9cbeginning of linesxe2x80x9d and xe2x80x9cend of lines.xe2x80x9d
Although the beginnings of lines are almost aligned on the document, ends of lines are not aligned. As such, the other histogram displays the distribution where frequencies gradually decrease from one end to the other end, with the ends respectively corresponding to the beginnings and ends of lines. From this distribution, the beginning of lines of the document can be detected.
In this way, the line direction and the beginning of lines are detected and, as a result, the starting position of the document image at which the user starts reading the document is detected. This enables the orientation of the document image to be recognized.
Using this conventional method, however, a problem occurs when the background of a document image is inconsistent in the density or a document image includes a picture or the like. In this case, the precision of the orientation detection processing is deteriorated. More specifically, the background that is inconsistent in the density and the picture included in the document image may be reproduced in black pixels through the stated binarization processing. These black pixels are also counted together with the black pixels corresponding to the characters of the document for generating the histograms. Thus, the histogram, from which the line direction of the document is to be detected, will not display the stated distribution. Specifically, a part with a zero frequency and a part with a non-zero frequency alternate, with the parts with zero frequencies being spaced uniformly and the parts with non-zero frequencies being spaced uniformly.
The first object of the present invention is to provide an image processing apparatus that can recognize the orientation of a document image with a high degree of precision regardless of document types.
The second object of the present invention is to provide an image forming apparatus that can recognize the orientation of a document image with a high degree of precision regardless of document types.
The first object of the present invention can be achieved by an image processing apparatus made up of: a pseudo gradation process on image data of a document image according to a pseudo halftone reproduction method; an N-value processing unit which generates N-value image data (Nxe2x89xa72) using the image data of the document image; and a recognition controller which recognizes an orientation of the document image using the N-value image data generated by the N-value processing unit.
With this construction, the image data of the document image is converted into the N-value image data independently of the conversion performed by the pseudo gradation processing unit that performs the pseudo gradation process on the image data of the document image according to the pseudo halftone reproduction method. Using the N-value image data, the orientation of the document image is recognized. The image data on which the pseudo gradation processing unit has performed the pseudo gradation process includes the halftone image information as well as character image information. Thus, when the orientation of the document image is recognized using this image data, there would be a high probability of incorrect recognition. By means of the present invention, the N-value processing unit is provided separately from the pseudo gradation processing unit. The N-value processing unit can generate the N-value image data so that the halftone image information is included as less as possible. As a result, the orientation of the document image can be recognized using the N-value image data with a high degree of precision.
The first object of the present invention can be also achieved by an image processing apparatus made up of: a receiving unit which receives image data of a document image; a first binarizing circuit which binarizes the image data received by the receiving unit to generate first binarized image data, according to a first method; an image processing circuit which performs an image process on the first binarized image data; a second binarizing circuit which binarizes the image data received by the receiving unit to generate second binarized image data, according to a second method that is different from the first method; and a recognition controller which recognizes an orientation of the document image using the second binarized image data.
With this construction, the image data of the document image is binarized independently of the binarization performed on the image data for the image process by the first binarizing circuit. Using the independently binarized image data, the orientation of the document image is recognized. The image data on which the binarization has been performed for the image process by the first binarizing circuit includes the halftone image information as well as character image information. Thus, when the orientation of the document image is recognized using this binarized image data, there would be a high probability of incorrect recognition. By means of the present invention, the second binarizing circuit is provided separately from the first binarizing circuit. The second binarizing circuit can generate the binarized image data to be used for recognizing the orientation of the document image so that the halftone image information is included as less as possible. As a result, the orientation of the document image can be recognized using the binarized image data with a high degree of precision.
The second object of the present invention can be achieved by an image forming apparatus made up of: a receiving unit which receives image data of a document image; a pseudo gradation processing unit which performs a pseudo gradation process on the image data received by the receiving unit according to a pseudo halftone reproduction method; an image forming unit which reproduces the document image using the image data on which the pseudo gradation processing unit has performed the pseudo gradation process; an N-value processing unit which converts the image data received by the receiving unit into N-value image data (Nxe2x89xa72) expressed by N-level of values; and a recognition controller which recognizes an orientation of the document image using the N-value image data generated by the N-value processing unit.
With this construction, the image data of the document image is converted into the N-value image data independently of the conversion performed by the pseudo gradation processing unit that performs the pseudo gradation process on the image data to reproduce the document image. Using the N-value image data, the orientation of the document image is recognized. The image data on which the pseudo gradation processing unit has performed the pseudo gradation process includes the halftone image information as well as character image information. Thus, when the orientation of the document image is recognized using this image data, there would be a high probability of incorrect recognition. By means of the present invention, the N-value processing unit is provided separately from the pseudo gradation processing unit. The N-value processing unit can generate the N-value image data so that the halftone image information is included as less as possible. As a result, the orientation of the document image can be recognized using the N-value image data with a high degree of precision.